package geektime.spring.springbucks.waiterservice.support;

import org.joda.money.Money;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.WritingConverter;

@WritingConverter
public class MoneyWriteConverter implements Converter<Money, Long> {

  @Override
  public Long convert(Money money) {
    return money.getAmountMinorLong();
  }
}
